<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>关注</title>
<script type="text/javascript" src="script/jquery-1.7.2.js"></script>

<script type="text/javascript">
	function showMyFriends(){
		$.post("sina/myfriends",function(data){
			var success = data.success;
			if(success == 0){
				//成功
				var myfriends = data.myfriends;
				var num = myfriends.length;
				var show_friends_str = "";
				for(var i = 0; i < num; i++){
					var name = myfriends[i].name;//名字
					var location = myfriends[i].location;//地址
					var friendsCount = myfriends[i].friendsCount;//关注数
					var followersCount = myfriends[i].followersCount;//粉丝数
					var statusesCount = myfriends[i].statusesCount;//微博数
					var description = myfriends[i].description;//简介
					var followMe = myfriends[i].followMe;//是否关注我
					show_friends_str += "<div>";
					show_friends_str += name;
					show_friends_str += " "+location;
					if(followMe){
						//相互
						show_friends_str +="&nbsp &nbsp &nbsp &nbsp &nbsp";						
						show_friends_str +="相互关注";
					}	
					
					show_friends_str +="<br>";
					show_friends_str +="关注:"+friendsCount;
					show_friends_str +="|粉丝:"+followersCount;
					show_friends_str +="|微博:"+statusesCount;
					show_friends_str +="<br>";
					show_friends_str +="简介:"+description;					
									
					show_friends_str +="</div>";
					show_friends_str +="--------------------------------------------------------";
					show_friends_str +="<br>";
				}
				$("#showmyfriend").append(show_friends_str);
			}else{
				var login_url = data.login_url;
				$("#showmyfriend").append("<a href=\""+login_url+"\">"+login_url+"</a>");				
			}
		},"json");
	};

	$(function(){
		
		showMyFriends();
	});
</script>

</head>
<body>

<div id="showmyfriend">

</div>
	
</body>
</html>